package cn.demo.generator.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * 读取代码生成相关配置
 *
 * @author ruoyi
 */
@Component
@ConfigurationProperties(prefix = "gen")
@PropertySource(value = {"classpath:generator.yml"})
public class GenConfig
{
    /** 作者 */
    public static String author;

    /** 生成包路径前缀 */
    public static String packageNamePrefix;


    public static String getAuthor()
    {
        return author;
    }

    @Value("${author}")
    public void setAuthor(String author) {
        GenConfig.author = author;
    }

    public static String getPackageNamePrefix() {
        return packageNamePrefix;
    }

    @Value("${packageNamePrefix}")
    public void setPackageNamePrefix(String packageNamePrefix) {
        GenConfig.packageNamePrefix = packageNamePrefix;
    }

}
